﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Root.master" AutoEventWireup="true" CodeFile="issueddoc.aspx.cs" Inherits="Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">
    <div class="pageLabel">
        <dx:ASPxLabel ID="lbl_page" runat="server" Text="Отчет по выданным документам" Font-Size="Medium" Theme="iOS">
        </dx:ASPxLabel>
    </div>
    <div style="float: left; margin-left: 10px; margin-right: 10px;">
        <div style="margin-bottom: 10px">
            <table>
                <tr>
                    <td>
                        <dx:ASPxDateEdit ID="dt1" runat="server" HelpText="Период с:" Width="83px" Visible="False">
                            <HelpTextSettings Position="Top">
                            </HelpTextSettings>
                        </dx:ASPxDateEdit>
                    </td>
                    <td>
                        <dx:ASPxDateEdit ID="dt2" runat="server" HelpText="Период по:" Width="83px" Visible="False">
                            <HelpTextSettings Position="Top">
                            </HelpTextSettings>
                        </dx:ASPxDateEdit>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        <dx:ASPxComboBox ID="cbb_kontr" ClientInstanceName="cbbkontr" runat="server" ValueType="System.Int32" DataSourceID="ds_kontr"
                            TextField="NAME" ValueField="CODE" HelpText="организация" IncrementalFilteringMode="Contains">
                            <ClientSideEvents ButtonClick="function(s, e) { if (e.buttonIndex == 0)  cbbkontr.SetValue(null); }" />
                            <Buttons>
                                <dx:EditButton Text="X" ToolTip="очистить">
                                </dx:EditButton>
                            </Buttons>
                            <HelpTextSettings Position="Top">
                            </HelpTextSettings>
                        </dx:ASPxComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <dx:ASPxComboBox ID="cbb_user" ClientInstanceName="cbbuser" runat="server" ValueType="System.Int32" HelpText="сотрудник" DataSourceID="ds_worker" TextField="FIO" ValueField="CODE" IncrementalFilteringMode="Contains">
                            <ClientSideEvents ButtonClick="function(s, e) { if (e.buttonIndex == 0)  cbbuser.SetValue(null); }" />
                            <Buttons>
                                <dx:EditButton Text="X" ToolTip="очистить">
                                </dx:EditButton>
                            </Buttons>
                            <HelpTextSettings Position="Top">
                            </HelpTextSettings>
                        </dx:ASPxComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <dx:ASPxComboBox ID="cbb_object" ClientInstanceName="cbbObject" runat="server" ValueType="System.Int32" HelpText="объект" DataSourceID="ds_Oject" TextField="NAME" ValueField="CODE" IncrementalFilteringMode="Contains">
                            <ClientSideEvents ButtonClick="function(s, e) { if (e.buttonIndex == 0)  cbbObject.SetValue(null); }" />
                            <Buttons>
                                <dx:EditButton Text="X" ToolTip="очистить">
                                </dx:EditButton>
                            </Buttons>
                            <HelpTextSettings Position="Top">
                            </HelpTextSettings>
                        </dx:ASPxComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <dx:ASPxButton ID="btnExec" runat="server" Text="Обновить" OnClick="btnExec_Click" Width="100%" Theme="iOS"></dx:ASPxButton>
                    </td>
                </tr>
            </table>

            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RegRar %>" ProviderName="<%$ ConnectionStrings:RegRar.ProviderName %>" SelectCommand="REP_PLACEBYKONTRAGENT" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                <SelectParameters>
                    <asp:ControlParameter ControlID="cbb_kontr" DbType="Int32" Name="KONTR" PropertyName="Value" />
                </SelectParameters>
            </asp:SqlDataSource>
        </div>
        <dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" EnableTheming="True"
            Theme="Metropolis" KeyboardSupport="True" KeyFieldName="ARCPLACE" Width="100%"
            ClientInstanceName="grid">

            <Columns>
                <dx:GridViewDataTextColumn VisibleIndex="12">
                    <DataItemTemplate>
                        <a href="/Arh/dogdoc.aspx?arcod=<%# Eval("ARCPLACE") %>" style="color: #000000">документы</a>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="OBJNAME" VisibleIndex="1" Caption="Объект" GroupIndex="0" SortIndex="0" SortOrder="Ascending"></dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="ARCOBJECT" VisibleIndex="2" Visible="False">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="ROOMNAME" VisibleIndex="3" Caption="Помещение" GroupIndex="1" SortIndex="1" SortOrder="Ascending">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="STRCODE" Visible="False" VisibleIndex="0">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="RACKNAME" VisibleIndex="4" Caption="Стелаж №" Width="80px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="SHELF" VisibleIndex="5" Caption="Полка №" Width="80px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="CELL" VisibleIndex="6" Caption="Ячейка №" Width="80px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="NUMBER" VisibleIndex="7" Caption="Папка №" Width="80px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="WORKER" Visible="False" VisibleIndex="8">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Сотрудник" FieldName="WORKERNAME" VisibleIndex="9" Width="100px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Caption="Статус" FieldName="STATE" VisibleIndex="11" Width="100px">
                    <PropertiesComboBox>
                        <Items>
                            <dx:ListEditItem Text="не определено " Value="0" />
                            <dx:ListEditItem Text="на месте " Value="1" />
                            <dx:ListEditItem Text="выдана" Value="2" />
                            <dx:ListEditItem Text="в спецификации" Value="3" />
                        </Items>
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataTextColumn Caption="Организация" FieldName="KONTR" VisibleIndex="10" Width="220px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn VisibleIndex="13">
                    <DataItemTemplate>
                        <a href="/doc/orderdoc.aspx?dcod=<%# Eval("ORDERDOC") %>" style="color: #000000">перемещение</a>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
            </Columns>
            <SettingsBehavior AllowFocusedRow="True" />

            <SettingsPager AlwaysShowPager="True" PageSize="20">
            </SettingsPager>

            <Settings ShowFooter="True" ShowGroupPanel="True" ShowFilterBar="Auto" ShowFilterRowMenu="True" ShowHeaderFilterButton="True" />
            <Styles>
                <GroupRow BackColor="#CCCCCC">
                </GroupRow>
            </Styles>
        </dx:ASPxGridView>
        <asp:EntityDataSource ID="ds_worker" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableFlattening="False" EntitySetName="WORKER" Select="it.[CODE], it.[FIO]">
        </asp:EntityDataSource>
        <asp:EntityDataSource ID="ds_kontr" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableFlattening="False" EntitySetName="KONTRAGENT" GroupBy="" OrderBy="" Select="it.[CODE], it.[NAME]">
        </asp:EntityDataSource>
        <asp:EntityDataSource ID="ds_Oject" runat="server" ConnectionString="name=RegistRar" DefaultContainerName="RegistRar" EnableFlattening="False" EntitySetName="ARCOBJECT" Select="it.[CODE], it.[NAME]"></asp:EntityDataSource>
    </div>
</asp:Content>

